package com.xmb.wcapi.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xmb.wcapi.dto.DutyAgoSaDTO;
import com.xmb.wcapi.entity.DutyAgo;
import com.xmb.wcapi.mapper.DutyAgoDataMapper;
import com.xmb.wcapi.mapper.DutyAgoMapper;
import com.xmb.wcapi.service.IDutyAgoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author huangping
 * @since 2024-04-12
 */
@Service
public class DutyAgoServiceImpl extends ServiceImpl<DutyAgoMapper, DutyAgo> implements IDutyAgoService {

    @Autowired
    private DutyAgoMapper dutyAgoMapper;

    @Autowired
    private DutyAgoDataMapper dutyAgoDataMapper;

    @Override
    public IPage<DutyAgo> selectInfoPage(Page<?> page, DutyAgoSaDTO ago) {
        page.setSearchCount(false);
        Long count = dutyAgoMapper.selectInfoPageCOUNT(ago);
        IPage<DutyAgo> agoIPage = dutyAgoMapper.selectInfoPage(page, ago);
        agoIPage.setTotal(count);
        return agoIPage;
    }

}
